﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace BLL.Services.Requests.Listing
{
    public class RequestsListing
    {

        public RequestsListing()
        {
            Requests = new List<Request>();

            Filter = new RequestsFilter();
        }

        public int Page { get; set; }

        public int Size { get; set; }

        public string Column { get; set; }

        public int Direction { get; set; }

        public int TotalPages { get; set; }

        public RequestsFilter Filter { get; set; }

        public List<Request> Requests { get; set; }

        public class Request
        {
            [UIHint("hidden")]
            public int RequestId { get; set; }

            [Display(Name = "User name")]
            public string Name { get; set; }

            [Display(Name = "Content")]
            public string Content { get; set; }

            [Display(Name = "Duration")]
            public int Duration { get; set; }

            public DateTime DateOfPublish { get; set; }

            [Display(Name = "Audio File")]
            public string AudioFile { get; set; }

            [Display(Name = "Date of publish")]
            public string DateOfPublishToStr
            {
                get
                {
                    return DateOfPublish.ToShortDateString();
                }
            }
        }
    }
}
